package com.lantosec.hmrp.modules.supplier.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.supplier.vo.SupplierBadVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 供应商不良记录 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-02-21
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SupplierBad extends BaseEntity<SupplierBadVO> {

    private static final long serialVersionUID = 1L;
    public SupplierBad(SupplierBadVO vo){
        this.badId = vo.getBadId();
        this.badType = vo.getBadType();
        this.supplierCode = vo.getSupplierCode();
        this.supplierName = vo.getSupplierName();
        this.uploadId = vo.getUploadId();
        this.linkmanList = vo.getLinkmanList();
        this.badContent = vo.getBadContent();
        this.badDate = vo.getBadDate();
        this.stopFlag = vo.getStopFlag();
        this.blacklistFlag = vo.getBlacklistFlag();
        this.submitFlag = vo.getSubmitFlag();
        this.createTime = vo.getCreateTime();
        this.createUserId = vo.getCreateUserId();
        this.createUser = vo.getCreateUser();
        this.handleTime = vo.getHandleTime();
        this.handleUserId = vo.getHandleUserId();
        this.handleUser = vo.getHandleUser();
        this.handleContent = vo.getHandleContent();
        this.handleState = vo.getHandleState();
    }

    @Override
    public SupplierBadVO convertToVO(){
        return new SupplierBadVO(this);
    }


    /**
     * 不良记录ID
     */
    @TableId(value = "bad_id", type = IdType.ASSIGN_UUID)
    private String badId;

    /**
     * 不良行为类型，字典表ID
     */
    private String badType;

    /**
     * 供应商编码
     */
    private String supplierCode;

    /**
     * 供应商名称
     */
    private String supplierName;

    /**
     * 上传附件ID
     */
    private String uploadId;

    /**
     * 不良行为对应的供应商联系人列表
     */
    private String linkmanList;

    /**
     * 不良行为内容
     */
    private String badContent;

    /**
     * 不良行为发生日期
     */
    private String badDate;

    /**
     * 是否暂停采购(0否1是)
     */
    private Integer stopFlag;

    /**
     * 是否接入黑名称(0否1是)
     */
    private Integer blacklistFlag;

    /**
     * 是否提交上级(0否1是)
     */
    private Integer submitFlag;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 创建人ID
     */
    private String createUserId;

    /**
     * 创建人
     */
    private String createUser;

    /**
     * 处置时间
     */
    private Date handleTime;

    /**
     * 处置人ID
     */
    private String handleUserId;

    /**
     * 处置人
     */
    private String handleUser;

    /**
     *  处置状态
     */
    private String handleState;

    /**
     *  处置说明
     */
    private String handleContent;


    public enum ColName {
        bad_id, bad_type, supplier_code, supplier_name, linkman_list, bad_content, bad_date, stop_flag, blacklist_flag, submit_flag, create_time, create_user_id, create_user, handle_time, handle_user_id, handle_user, handle_state, handle_content
    }
}
